home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / MouseInfo 1.0.1 / MMouseInfo.cp < prev    next >
Encoding:
Text File  |  1992-07-15  |  1.7 KB  |  61 lines  |  [TEXT/MPS ]

  1. //     MMouseInfo.cp
  2. //     Copyright © 1992 by Apple Computer, Inc. All rights reserved.
  3. //    Kent Sandvik DTS
  4. //    This is the main-main file, it all starts here...
  5. //    Version Info (latest first):
  6. //
  7. //    <1>        khs        1.0        First final version
  8. //    <2>        khs        1.0.1    Fixed a memory leak in TMapApplication::GetSleepValue()
  9.  
  10.  
  11. // INCLUDES
  12. #ifndef __MOUSEINFO__
  13. #include "UMouseInfo.h"
  14. #endif
  15.  
  16. #ifndef __UMENUEDWINDOW__
  17. #include "UMenuedWindow.h"
  18. #endif
  19.  
  20. #ifndef __MOUSETRACKBEHAVIOR__
  21. #include "UMouseTrackBehavior.h"
  22. #endif
  23.  
  24.  
  25. // T H E   M A I N    P R O G R A M
  26. #pragma processor 68000
  27. #pragma segment Main
  28.  
  29. TMapApplication* gMapApplication = NULL;        // the application object 
  30. RgnHandle gtempRgn;                                // used for sleep region calculations
  31.  
  32.  
  33. void main()
  34. {
  35.     InitToolBox();                                // essential toolbox and utilities initialization
  36.  
  37.     // make sure we can run
  38.     if (ValidateConfiguration(gConfiguration) && gConfiguration.hasColorQD)
  39.     {
  40.         // we made it! Continue with remainder of initialization 
  41.         gtempRgn = MakeNewRgn();                // create the region needed for sleep region calcs
  42.  
  43.         InitUMacApp(8);                            // initialize MacApp; 8 calls to MoreMasters
  44.         InitUDialog();                            // initialize the TDialog view handling
  45.         InitUFloatWindow();                        // initialize floating window units
  46.  
  47.         // construct a new TMapApplication object, allocation errors are checked for.
  48.         gMapApplication = new TMapApplication;
  49.         gMapApplication->IMapApplication(kFileType, kSignature);
  50.  
  51.         InitUMenuedWindow(mWindows);            // initialize UMenuedWindow Behavior module
  52.         InitMouseTrackBehavior();                // initialize Mouse Tracking behavior module
  53.  
  54.         gMapApplication->Run();                    // run the application, when it's done - exit.
  55.     }
  56.     else
  57.         StdAlert(phUnsupportedConfiguration);
  58. }
  59.  
  60.  
  61.